//
// Created by JYL on 2024-06-23.
//

#include "key.h"

#define KB1     HAL_GPIO_ReadPin(KEY1_GPIO_Port,KEY1_Pin)
#define KB2     HAL_GPIO_ReadPin(KEY2_GPIO_Port,KEY2_Pin)
#define KB3     HAL_GPIO_ReadPin(KEY3_GPIO_Port,KEY3_Pin)
#define KEY_PORT    (KB1|KB2<<1|KB3<<2|0xf8)    // 0000 0111

uint8_t Trg,Cont;
void KEY_Read(void)
{
    uint8_t ReadData=KEY_PORT^0xff;
    Trg = ReadData & (ReadData ^ Cont);
    Cont = ReadData;
}
